﻿namespace Example
{
    using System;
    using System.Linq;
    using System.Web.Mvc;

    using Xunit;

    public sealed class MvcApplicationFacts
    {
        [Fact]
        public void op_RegisterGlobalFilters_GlobalFilterCollection()
        {
            var filters = new GlobalFilterCollection();

            MvcApplication.RegisterGlobalFilters(filters);

            Assert.Equal(1, filters.Count);
            Assert.IsType<HandleErrorAttribute>(filters.First().Instance);
        }

        [Fact]
        public void op_RegisterGlobalFilters_GlobalFilterCollectionNull()
        {
            Assert.Throws<ArgumentNullException>(() => MvcApplication.RegisterGlobalFilters(null));
        }
    }
}